﻿using System;
using System.Web.Core;

namespace Forum.Business
{
    public class ForumSite : BaseSite
    {
        public override void CreateUser(MemberInfo memberInfo)
        {
            if (memberInfo != null)
            {
                ForumUser user = new ForumUser();

                user.MemberId.Value = memberInfo.MemberId;
                user.NickName.Value = memberInfo.MemberAttributes["NickName"] as string;
                user.Email.Value = memberInfo.MemberAttributes["Email"] as string;

                CreateUser(user);
            }
        }
        public override void DeleteUser(Guid memberId)
        {
            DeleteUser<ForumUser>(memberId);
        }
        public override void UpdateUserAttributes(Guid memberId, string attributeName, string attributeValue)
        {
            UpdateUserAttributes(GetUser<ForumUser>(memberId), attributeName, attributeValue);
        }
    }
}